package com.ricci.synergybridge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ricci.synergybridge.mapper.UserTeamMapper;
import com.ricci.synergybridge.model.domain.UserTeam;
import com.ricci.synergybridge.service.UserTeamService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户队伍服务实现类
 *
 */
@Service
public class UserTeamServiceImpl extends ServiceImpl<UserTeamMapper, UserTeam>
        implements UserTeamService {

    @Override
    public List<Long> getUserIdList(long teamId) {
        QueryWrapper<UserTeam> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("team_id", teamId);
        List<UserTeam> userTeamList = this.list(queryWrapper);
        List<Long> userIdList = new ArrayList<>();
        for (UserTeam userTeam : userTeamList) {
            userIdList.add(userTeam.getUserId());
        }
        return userIdList;
    }
}




